# Makefile for building the kernel tpm device drivers outside of the kernel
# Will build for the currently booted kernel and the drivers will remain in
# the current directory
#

ASYNC =
ASYN =

TARGET := kernel_asym_perf
obj-m := $(TARGET).o
$(TARGET)-objs = kernel_test_asym.o asym_asyn.o

# If run command 'make ASYNC=enable', the macro 'ASYN_RESOURCE_RECOVERY' will enable.
# The macro 'ASYN_RESOURCE_RECOVERY' is used to enable the asynchronization mode which
# released resources at dequeue part.
# In default, ASYNC is disabled. Therefore, the defult mode is synchronization mode
# which released resources at enqueue part.
ifeq ($(ASYNC), enable)
EXTRA_CFLAGS += -DASYN_RESOURCE_RECOVERY
else ifeq ($(ASYN), enable)
EXTRA_CFLAGS += -DASYN_RESOURCE_RECOVERY
endif

KDIR	:= /lib/modules/$(shell uname -r)/build
PWD	:= $(shell pwd)

modules:
	cp ../CCP907_SEC_MODULE/CCP903_SEC_BASE/Module.symvers ./
	$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean
	rm .cache*
